<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <!-- v-for="操作对象 in 集合"  -->
        <div v-for="user in userlist">
            {{user.name}}--- {{user.age}}

        </div>
        
        <h1>------------------------------</h1>

        <!-- 获取索引值 -->
        <div v-for="(user,index) in userlist">
            {{index}}---{{user.name}}---{{user.age}}
        </div>
    </div>
    <script src="vue.min.js"></script>
    <script>
        new Vue({
            el: '#app',
            data: {
                userlist: [
                    { name: 'Lingtong Sun', age: 20 },
                    { name: 'Haifu Liu', age: 30 },
                    { name: 'Duanrui Wang', age: 12 },
                    { name: 'Dongxue Gao', age: 18 }
                ]
            }
        })
    </script>
</body>

</html>